package com.example.goband.Service;

import com.example.goband.Mapper.UserMapper;
import com.example.goband.model.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22479
 * Date: 2023-06-01
 * Time: 20:51
 */
@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    public User selectByName(String username) {
        return userMapper.selectByName(username);
    }

    public int insert(User user) {
        return userMapper.insert(user);
    }

    public void userWin(int userId) {
        userMapper.userWin(userId);
    }

    public void userLose(int userId) {
        userMapper.userLose(userId);
    }

        public static void main(String[] args) {
            // TODO Auto-generated method stub
            int[] a = new int[10];
            a[0] = 0;
            a[1] = 1;
            a[2] = 2;
            a[3] = 3;
            a[4] = 4;
            a[5] = 5;
            System.arraycopy(a, 2, a, 3, 4);
            a[2]=99;
            for (int i = 0; i < a.length; i++) {
                System.out.print(a[i] + " ");
            }
        }
}
